package jmine.tec.web.front.sample.pages.form;

import java.util.ArrayList;
import java.util.List;

import jmine.tec.web.front.pages.form.AbstractHandledFormPanel;
import jmine.tec.web.wicket.component.MapsWicketDateTextField;
import jmine.tec.web.wicket.pages.form.FormType;

import org.apache.wicket.Component;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.IModel;

/**
 * Sample form to create or view handled forms entities
 * 
 * @author israel.crisanto
 */
public class BackOfficeRequestSamplePanel extends AbstractHandledFormPanel {

    /**
     * @param id markup id
     * @param formType form type
     * @param panelModel panel model object
     */
    public BackOfficeRequestSamplePanel(String id, IModel<?> panelModel, FormType formType) {
        super(id, panelModel, formType);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<Component> createFormComponents() {
        List<Component> components = new ArrayList<Component>();
        components.add(new TextField("importantString").setRequired(true));
        components.add(new TextField("importantNumber").setRequired(true));
        components.add(MapsWicketDateTextField.forDatePattern("importantDate").setRequired(true));
        components.add(new TextField("meaninglessString"));
        return components;
    }
}
